#pragma once

namespace Rendering {

class Renderer;

class Shader
{
public:
	Shader(Renderer* renderer, std::string vertexShaderFile, std::string pixelShaderFile, D3D11_INPUT_ELEMENT_DESC elementLayout[], int layoutDescNumElems);
	virtual ~Shader(void){ }
	
	void Render(Renderer* renderer);

	void AppendSamplerState(_In_ ID3D11Device* device);
	
	///<summary>Gets the count of the sampler.</summary>
	///<value>The count of the sampler.</value>
	int SamplerCount() { return static_cast<int>(m_samplerStates.size()); }

protected:
	void CreateSamplerState(_In_ ID3D11Device* device, _Out_ ID3D11SamplerState** samplerState);
	HRESULT CreateSamplerState(_In_ ID3D11Device* device, _In_ D3D11_SAMPLER_DESC colorMapDesc, _Out_ ID3D11SamplerState** samplerState);

	ID3D11VertexShaderPtr					 m_vertexShader;
	ID3D11PixelShaderPtr					 m_pixelShader;

	std::vector<ID3D11SamplerStatePtr>       m_samplerStates;
	ID3D11InputLayoutPtr					 m_inputLayout;
};

}